<?
require_once('../../system/config.php');
require_once 'DB.php';
require_once '../classes/ArticlesFactory.php';
$db = DB::connect($dsn);

$articles= new ArticlesFactory($db);

$table = $articles->getTable();
$id = $table->nextID();
/*$cols_vals = array(
    'id'       => $id,
    'title'    => 'Mykhailo',
    'description'    => '1256',
    'signdate' => '2006-10-12',
    'email'    => 'come@on.com'
);

$articles->addArticle($cols_vals);
*/

// Use the factory method here
$article = $articles->getArticle();
echo ( "<h1>".$article->title()."</h1>\n" );
  /*
while ( $article = $articles->getArticle() ) {
    echo ( "<h1>".$article->title()."</h1>\n" );
    echo ( "<div id=\"author\">" );
    echo ( "<i>".$article->author()."</i>" );
    echo ( "</div>\n" );
    echo ( "<div id=\"date\">" );
    echo ( "<i>".$article->date()."</i>" );
    echo ( "</div>\n" );
    echo ( "<div id=\"body\">".$article->body()."</div>\n" );
}
*/


?>